//  const proxyConfig = require('./proxy.config.js')
const toastConfig = require('./toast.config.js')
module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: '2019高考志愿填报_新高考选科_查大学_查专业_知涯志愿',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { name: 'keywords', content: '2019高考志愿填报模拟，新高考智能选科，查分数线，查大学，查专业，查职业、高考政策，志愿讲座，志愿专家，自我测评，智能选科，生涯规划，学业规划，职业规划，知涯志愿，知涯选科，知涯教育，知涯' },
      { hid: 'description', name: 'description', content: '高考志愿填报模拟系统，新高考选科测评系统，科学挑大学选专业，查询分数线，大学排行榜，专业排行榜，最新高考政策，填报时间，新高考智能选科，院校智能推荐，志愿模拟填报，高考志愿讲堂，高考志愿专家一对一，填报手册，填报技巧，报考指南，性格测评，就业指南，新高考选科模拟，生涯教育，学业规划，职业规划，生涯规划，陪伴青少年成长，用知涯不浪费一分，全国咨询热线：400-9682-686' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'stylesheet', type: 'text/css', href: '/styles/swiper.min.css' }
    ],
    script: [{
      src: '/scripts/baidu.js'
    }]
  },
  css: [
    '~/assets/scss/common.scss' // 公共样式
  ],
  /*
  ** Customize the progress bar color
  */
  loading: {
    color: '#a3e043',
    height: '3px'
  },
  // '~/components/loading.vue',
  env: {
    _ENV: process.env._ENV
  },
  router: {
    middleware: 'permission'

  },
  /*
  ** Build configuration
  */
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy',
    '@nuxtjs/toast'
  ],
  toast: toastConfig,
  // 接口代理模块引入
  // proxy: proxyConfig,
  plugins: [
    '~/plugins/global.js',
    '~/plugins/axios.js',
    '~/plugins/globalComponents.js',
    '~/plugins/lodash.js',
    '~/plugins/validate.js',
    '~/plugins/qrcode.js',
    '~/plugins/vuescroll.js',
    '~/plugins/route',
    { src: '~/plugins/pdf', ssr: false },
    { src: '~/plugins/ElementUI', ssr: true },
    { src: '~/plugins/vuexCookie.js', ssr: false },
    { src: '~/plugins/vuexStorage.js', ssr: false }
  ],
  build: {
    /*  filenames: {
      chunk: ({ isDev }) => isDev ? '[name].js' : '[name][chunkhash].js',
      css: ({ isDev }) => isDev ? '[name].js' : '[name][contenthash].css'
    }, */
    extractCSS: true,
    //  减少应用 bundle 的体积
    vendor: [
      '~/components/majorList',
      '~/components/comSelect',
      'vue-awesome-swiper'
    ],
    /* extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }, */
    extend (config, { isDev }) {
      if (isDev && process.client) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    },
    styleResources: {
      scss: ['./assets/scss/vars.scss', './assets/scss/base.scss']
    },
    postcss: [
      require('autoprefixer')({
        browsers: ['last 10 Chrome versions', 'last 10 Firefox versions', 'Safari >= 6', 'ie> 8']
      })
    ]
  }
}
